<!DOCTYPE html>
<html lang="en">
<style>
    ul.group-list li {
        white-space: nowrap;float: left;
        width: 150px; height: 25px;
        padding: 3px 5px;list-style-type: none;
        list-style-position: outside;border: 0px;margin: 0px;
    }
    input[type=checkbox], input[type=radio] {
        display: inline-block;
    }
</style>

{include file="Public/head"}

<body data-type="widgets">
<script src="/assets/js/theme.js"></script>
<div class="am-g tpl-g">

    {include file='Public:header'}
    {include file='Public:menu2'}



    <!-- 内容区域 -->
    <div class="tpl-content-wrapper" >
        <div class="row-content am-cf">
            <div class="row">

                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title am-fl">新增</div>
                            <div class="widget-function am-fr">
                                <a href="javascript:;" class="am-icon-cog"></a>
                            </div>
                        </div>
                        <div class="widget-body am-fr">
                            <!--<form id="roleform" form="submit" class="am-form tpl-form-border-form tpl-form-border-br">-->
                            <form method="post" id="roleform" form="submit">
                                <!--通用信息-->
                                <div class="tab-content">
                                    <div class="tab-pane active" id="tab_tongyong">

                                        <table class="table table-bordered">
                                            <tbody>
                                            <tr>
                                                <td>用户id</td>
                                                <td>

                                                    <a href="">{$withdrawals.user_id}</a>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>用户名</td>
                                                <td> {$withdrawals.nickname}</td>
                                            </tr>
                                            <tr>
                                                <td>用户平台余额</td>
                                                <td>{$withdrawals.user_money}</td>
                                            </tr>
                                            <tr>
                                                <td>用户平台佣金</td>
                                                <td>{$withdrawals.commission}</td>
                                            </tr>
                                            <tr>
                                                <td>申请提现金额</td>
                                                <td style="color:dodgerblue;">{$withdrawals.money} </td>
                                            </tr>
                                            <tr>
                                                <td>申请提现银行</td>
                                                <td>{$withdrawals.bank_name}</td>
                                            </tr>
                                            <tr>
                                                <td>银行账号</td>
                                                <td>{$withdrawals.account_bank}</td>
                                            </tr>
                                            <tr>
                                                <td>银行账户名</td>
                                                <td>{$withdrawals.account_name}</td>
                                            </tr>
                                            <tr>
                                                <td>申请时间</td>
                                                <td>{$withdrawals.create_time} </td>
                                            </tr>
                                            <tr>
                                                <td>状态</td>
                                                <td>{if $withdrawals.status==0}申请中
                                                    {elseif $withdrawals.status==1}申请成功
                                                    {elseif $withdrawals.status==2}申请失败{/if}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>备注</td>
                                                <td>
                                                    <textarea rows="4" cols="60" id="remark" name="remark"  {if $withdrawals.status==2}disabled="disabled"{/if}>{$withdrawals.remark}</textarea>
                                                    <span id="err_remark" style="color:#F00; display:none;"></span>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>提现流程:</td>
                                                <td>
                                                    1:用户前台申请提现<br>
                                                    2:管理员审核生成转账记录 ( 生成时自动扣除用户平台余额 ) <br>
                                                    3:财务线下转账给用户<br>
                                                    或 2 , 3步可以调换,先转账后生成记录.<br>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <div class="pull-right">
                                    <input type="hidden" name="id" value="{$withdrawals.id}">
                                    <input type="hidden" name="user_id" value="{$withdrawals.user_id}">
                                    <input type="hidden" id="status" name="status" value="0">
                                    {if $withdrawals.status==0}
                                    <button class="btn btn-primary" data-toggle="tooltip" type="submit">提现（生成转账记录）</button>
                                    <button class="btn btn-primary" data-toggle="tooltip" type="button" onclick="refuseWithdrawals({$withdrawals.id});">拒绝提现</button>
                                    {/if}
                                </div>
                            </form>

                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

</body>
{include file='Public:script'}
{include file='Public:validation'}
<script>
    //拒绝提现
    function refuseWithdrawals(id) {
        $.post("{:url('refuse')}", {id: id}, function(res) {
            if (res.code != 200) {
                layer.msg(res.msg, {shade: 0.5, time: 1000, icon: 2});
                return false;
            }
            layer.msg(res.msg, {shade: 0.5, time: 1000, icon: 1}, function() {
                layer.closeAll('page');
                location.reload();
            });
        });
    }
    //提交
    function roleSubmit(){
        var form=document.getElementById("roleform");
        var formData=new FormData(form);
        $.ajax({
            url:"{:Url('addData')}",
            type:'POST',
            data:formData,
            async: false,
            cache: false,
            contentType: false, //不设置内容类型
            processData: false, //不处理数据
            success:function(res){
                console.log(res);
                if (res.code != 200) {
                    layer.msg(res.msg, {shade: 0.5, time: 2000,icon: 2});
                    return false;
                }
                layer.msg(res.msg, {shade: 0.5, time: 2000, icon: 1}, function(){
                    window.location.href=document.referrer;

                });
            }
        });
    }
</script>

</html>